{include file="public/head"}
<div class="main">
    {include file="public/left"}
    <div class="middle">
    {include file="public/header"}
    <div class='airtical_detail'>
        <div class="list_detail">
            <h5><span id="cat_name">{:__('文章列表')}</span><span>（{:__('共')}&nbsp;<span id="total">0</span>&nbsp;{:__('条')}）</span></h5>
            <ul>
            </ul>
            <div id="in_page"></div>
        </div>
        {include file="public/articalright"}
    </div>
    {include file="public/foot"}
    </div>
    {include file="public/right"}
</div>
{include file="public/footer"}
<script>

    var total = 0;
    function get_artical_lidt(page){
        $.ajax({
            url:'/api/info/index',
            type:'get',
            data:{page:page,limit:10,cat_id:"{$catid}"},
            success:function(ret){
                if(ret['code'] == 1){
                    if(ret['data'] == '' || ret['data'] == null || ret['data'] == undefined){
                        return false;
                    }
                    if(ret['data']['ls'] == '' || ret['data']['ls'] == null || ret['data']['ls'] == undefined){
                        return false;
                    }
                    data = ret['data']['ls'];
                    var htl = '';
                    for(i in data){
                        htl += '<dl><a href="/'+data[i]['route']+'">'+data[i]['title']+'</a><span>{:__("发表于")}：'+data[i]['create_time']+'</span></dl>';
                    }
                    $(".list_detail ul").html(htl);
                    total = ret['data']['total'];
                    if(total == '' || total == undefined || total == null){
                        total = 0;
                    }
                    $("#total").text(total);
                    if(page == 1){
                        getpage();
                    }
                } else if(ret['code'] != 401){
                    layer.msg(ret['msg'],{icon:2});
                }
                
            }
        });
    }
    get_artical_lidt(1);
    
    function getpage(){
        createpage('in_page',total,10,function(obj,first){
            var nowpage = obj.curr;
            if(!first){
                get_artical_lidt(nowpage);
            }
        });
    }
</script>